﻿@{
    //Layout = null;
}
<script type="text/javascript">
    function ClearContent() {
        // document.getElementById("hid_actiontype").value = "add";

        //// document.getElementById("hid_edit_guid").value = "";//清除隐藏域内容
        // document.getElementById("txt_Name").value = "";
        // document.getElementById("txt_Remark").value = "";
        // document.getElementById("txt_Order").value = "1";

    }
    function saveInfo() {
        var rolename = $("#txt_Name").val();
        if (rolename == '') {
            alert("请填写账号");
            return;
        }

        var rolemenu = $("#txt_pwd").val();
        if (rolemenu == '') {
            alert("请填写密码");
            return;
        }

        var data = $("#addForm").serializeArray(); //自动将form表单封装成json


        //编辑
        $.post("SaveSipInfo?guid=" + document.getElementById("hid_emp_guid").value, data, retrunResult2, "json");


    }


    function retrunResult2(respBean) {
        var code = respBean[0].respCode;
        var msg = respBean[0].respMsg;
        //alert(msg);
        if (code == '000000') {
            //
            $("#addDialog").dialog("close");
        }
        else if (code == '200000') {
            alert(msg);
            $("#addDialog").dialog("close");
        }
        else {
            $(".ui-button ui-corner-all ui-widget").attr('disabled', false);
            $(".load_data").hide();
            alert(msg);
        }
    }
    function delInfo() {
        var data = $("#searchForm").serializeArray();
        $.post("Del", data, retrunResult, "json");
    }
    function ShowEditMsg() {

        var rowscount = 0;
        var cbvalue = document.getElementById("hid_emp_guid").value;


        //显示要编辑的内容
        $.post("GetSipInfo", { editguid: cbvalue }, function (result) {
            var jsonresult = eval(result);
            if (jsonresult[0].respCode == "200") {
                document.getElementById("txt_Name").value = jsonresult[0].name;
                document.getElementById("txt_pwd").value = jsonresult[0].pwd;
                document.getElementById("txt_IP").value = jsonresult[0].ip;
                $("#addDialog").dialog("open");

            }
            else {
                //  alert(jsonresult[0].respMsg);
                return;
            }

        });

    }

</script>
<!-- 部门添加 -->
<div id="addDialog" title="坐席设置">
    <form action="" name="addForm" id="addForm" method="post">

        <div class="kv-item clearfix">
            <label><span class="impInfo">*</span>坐席工号：</label>
            <div class="kv-item-content">
                <input type="text" name="txt_Name" id="txt_Name" placeholder="工号" />
            </div>
        </div>

        <div class="kv-item clearfix">
            <label><span class="impInfo">*</span>坐席密码：</label>
            <div class="kv-item-content">
                <input type="text" name="txt_pwd" id="txt_pwd" placeholder="密码" />
            </div>
        </div>

        <div class="kv-item clearfix">
            <label><span class="impInfo">*</span>SIP话机IP：</label>
            <div class="kv-item-content">
                <input type="text" name="txt_IP" id="txt_IP" placeholder="如：192.168.0.1" />
            </div>
        </div>
        <div style="text-align:center">
            <img src="/common/images/load.gif" alt="加载中..." class="load_data" style="display:none" width="30" height="30" />
        </div>
    </form>
</div>



<!-- 角色删除 -->
<div id="delDialog" title="记录删除">
    <p>你确定要删除选中的记录？</p>
    <div style="text-align:center">
        <img src="/common/images/load.gif" alt="加载中..." class="load_data" style="display:none" width="30" height="30" />
    </div>
</div>
